// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
// import router from './router'
import Axios from "axios";
import qs from "qs";
import router from "./router/index";
import "./assets/css/index.css"
import store from "./Store/store.js";
import animate from 'animate.css';
import ElementUI from 'element-ui' //新添加
import 'element-ui/lib/theme-chalk/index.css';
import "./assets/font-awesome-4.7.0/css/font-awesome.min.css";
import "./assets/css/iconfont.css";
import "./assets/css/silde.css";
// import "../static/utils/silde.js"
import $ from "jquery";
// Vue.prototype.$router=Router;
Vue.prototype.$axios=Axios;
Vue.prototype.HOST="/api";
Vue.use(ElementUI);

Vue.config.productionTip = false;
Axios.interceptors.request.use(function (config) {
  // 在发送请求之前做些什么
  if(config.method=="post")
  {
    config.data=qs.stringify(config.data)
  }
  return config;
}, function (error) {
  // 对请求错误做些什么
  return Promise.reject(error);
});

// 添加响应拦截器
Axios.interceptors.response.use(function (response) {
  // 对响应数据做点什么
  return response;
}, function (error) {
  // 对响应错误做点什么
  return Promise.reject(error);
});

/* eslint-disable no-new */
new Vue({
  animate,
  router,
  store,
  $,
  el: '#app',
  router,
  components: { App},
  template: '<App/>'
})
